<?php
/*
Template Name: Page - Search
Author: Najeeb (ceo@najeebmedia.com)
*/
?>


<?php get_header(); ?>
<style>
.sidebar ul{margin:0; padding:0}
.sidebar ul li{border-bottom:#CCC 1px solid; padding:10px;}
</style>


<script type="text/javascript">
jQuery(document).ready(function(e) {
	
	jQuery("#loading").hide();

    jQuery("#slider-range" ).slider({
   		stop: function(event, ui) {
			jQuery("#loading").show(); 
			doSubmit();
		}
	});
	
	doSubmit();
});

function doSubmit(){
	jQuery("#loading").show();
	//jQuery("#results").hide();

	cid=jQuery('#filterCat').val();
	
	if(jQuery('#radio1').attr("checked")==true) canon="total"; else canon="monthly";
	inFrom=jQuery('#investment-from').val();
	inTo=jQuery('#investment-to').val();
	c1=0;
	c2=0;
	c3=0;
	if(jQuery('#check1').attr("checked")==true) c1=3;
	if(jQuery('#check2').attr("checked")==true) c2=5;
	if(jQuery('#check3').attr("checked")==true) c3=8; 
	jQuery("#results").load('http://www.franquicia-t.com/search-results/',{cid: cid, canon: canon, inFrom: inFrom, inTo: inTo, c1: c1, c2: c2, c3: c3});	
	
	jQuery("#loading").hide();
	jQuery("#results").show();
}
</script>


   <!-- Content  2 column - left Sidebar  -->
        <div class="content right">
             <div class="content-title">
                <h2>Search Results</h2>
                <img src="http://www.franquicia-t.com/wp-content/uploads/2012/02/loading12.gif" id="loading" />
             </div>
             
	
      <div id="results">
      </div>
        </div> <!-- /Content -->
        
        <div class="sidebar left" >
        <ul>
        <input type="hidden" id="filterCat" value="<?php echo $_GET['filter'] ?>" />
    	<li>
        	<p><strong>Canon</strong></p>
    
         <div id="radios">
            <input type="radio" id="radio1" name="radio" onclick="doSubmit()" /><label for="radio1">Total</label>
            <input type="radio" id="radio2" name="radio" checked="checked" onclick="doSubmit()" /><label for="radio2">Monthly</label></div></li>
        
        <li>
        <p><label for="amount">Investment:</label>
		  <input type="text" size="3" id="investment-from" /> to <input type="text" size="3" id="investment-to" />
    	  <div id="slider-range"></div>
    	</p>
        </li>
        
        <li>
        <p><label for="amount">Rentabilidad :</label><br />
        <div id="format">
            <!--<input type="checkbox" id="3year" /><label for="3year">3 Years</label>
            <input type="checkbox" id="3year" /><label for="3year">5 Years</label>
            <input type="checkbox" id="3year" /><label for="3year">8 Years</label>-->
            <input type="checkbox" id="check1" onclick="doSubmit()" /><label for="check1"><?php _e('3 Years', 'templatic')?></label>
        	<input type="checkbox" id="check2" onclick="doSubmit()" /><label for="check2"><?php _e('5 Years', 'templatic')?></label>
        	<input type="checkbox" id="check3" onclick="doSubmit()" /><label for="check3"><?php _e('8 Years', 'templatic')?></label>
        </div>
    	</p>
        </li>
    </ul>
        </div>  <!-- sidebar #end -->
 <?php get_footer(); ?>